<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
  <ul class="nav nav-tabs">
    <li><a href="{:url('Article/index')}">{:lang('ADMIN_NAV_INDEX')}</a></li>
    <li class="active"><a href="{:url('Article/edit')}">{:lang('ADMIN_NAV_ADD')}</a></li>
    <!--<li><a  href="{:url('nav/edit')}" >{:lang('ADMIN_NAV_EDIT')}</a></li>-->
  </ul>
  <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Article/editPost')}">

    <div class="form-group">
      <label class="col-sm-2 control-label">
        <span class="x-red">*</span>文章标题
      </label>
      <div class="col-md-6 col-sm-10">
        <input type="text" name="title" value="{$data.title}" class="form-control">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"><span class="form-required">*</span>文章背景</label>
      <div class="col-md-6 col-sm-10">
        <input id="photo-1" type="hidden" name="image" value="{$data.image}">
        <img id="photo-1-preview" >
        <a class="btn btn-primary" href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">
        <span class="x-red">*</span>作者
      </label>
      <div class="col-md-6 col-sm-10">
        <input type="text" value="{$data.author}" name="author" class="form-control">
      </div>
    </div>
    <div class="form-group">
      <label  class="col-sm-2 control-label">
        <span class="x-red">*</span>文章分类
      </label>
      <div class="col-md-6 col-sm-10">
        <select class="form-control" name="category_id" >
          <option value="">请选择类别</option>
          <foreach name="category" item="v">
            <option value="{$v.category_id}">{$v.category_name}</option>
          </foreach>
        </select>
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label">
        <span class="x-red">*</span>描述
      </label>
      <div class="col-md-6 col-sm-10">
        <input type="text" name="desc"  value="{$data.desc}" class="form-control">
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"><span class="form-required">*</span>是否推荐</label>
      <div class="col-md-6 col-sm-10">
        <input type="radio" name="is_recom" value="1"<if $data.is_recom == 1>checked</if>> 是
        <input type="radio" name="is_recom" value="2"<if $data.is_recom == 2>checked</if>> 否
      </div>
    </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"><span class="form-required">*</span>是否显示</label>
      <div class="col-md-6 col-sm-10">
        <input type="radio" name="status" value="1"<if $data.status == 1>checked</if>> 是
        <input type="radio" name="status" value="2"<if $data.status == 2>checked</if>> 否
      </div>
    </div>
    <div class="form-group">
      <label  class="col-sm-2 control-label"><span class="form-required">*</span>文章内容</label>
      <div class="col-md-6 col-sm-12">
        <script type="text/plain" id="content" value="{$data.content}" name="content" style="height:300px"></script>
      </div>
    </div>
  <input type="hidden" name="art_id" value="{$data.art_id}">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-primary js-ajax-submit">{:lang("SAVE")}</button>
      <a class="btn btn-default" href="{:url('Article/index')}">返回</a>
    </div>
  </form>

</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
  //编辑器路径定义
  var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
  var editorcontent = new baidu.editor.ui.Editor();
  editorcontent.render('content');
</script>
</body>
</html>